#include "../skyAdapter.h"

#ifdef _SKYWIN_
#include "../skyTimer.h"

namespace Sky
{

TimerCallback _cb;
VOID  CALLBACK   adpTimerProc( HWND hwnd, UINT message, UINT iTimerID, DWORD dwTime)
{
	cb(1,2);
	return;
}

TBool OSTimer::CreateTimer( TInt timerID,TimerProc proc,TInt span ,TimerCallback cb)
{
	if(mCreated)
		return vTrue;
	myAdapData data;
	data.proc = proc;
	data.pUser = pUser;

	_cb = cb;

	TInt i = ::SetTimer(vNull,1,span/1000,adpTimerProc);
	DWORD R = ::GetLastError();
	mTimerID = timerID;
	mCreated = vTrue; 
	return vTrue;
}

TVoid OSTimer::DeleteTimer( TInt timerID )
{
	if(mCreated == vFalse)
		return;

	KillTimer(vNull ,timerID);
	mCreated = vFalse;
	return;
}



OSTimer::~OSTimer()
{
	DeleteTimer(mTimerID);
}
}
#endif
